package com.sikao.app.fragment.base;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.sikao.app.app.MyApplication;
import com.sikao.app.utils.SharepreferenceUtil;

/**
 * Created by y50 on 2016/4/15.
 * fragment基类，所有fragment都继承此基类
 */
public class BaseFragment extends Fragment {

	@Override
	public void onCreate(@Nullable Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		Log.d("FragmentName", this.getClass().getName()+"---------onCreate ");
	}

	@Override
	public void onAttach(Context context) {
		super.onAttach(context);
		Log.d("FragmentName", this.getClass().getName()+"---------onAttach ");
	}

	@Nullable
	@Override
	public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
		Log.d("FragmentName", this.getClass().getName()+"---------onCreateView ");
		return super.onCreateView(inflater, container, savedInstanceState);
	}

	@Override
	public void onActivityCreated(@Nullable Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		Log.d("FragmentName", this.getClass().getName()+"---------onActivityCreated ");
	}

	@Override
	public void onDetach() {
		super.onDetach();
		Log.d("FragmentName", this.getClass().getName()+"---------onDetach ");
	}

	@Override
	public void onResume() {
		super.onResume();
		Log.d("FragmentName", this.getClass().getName()+"---------onResume ");
	}

	@Override
	public void onPause() {
		super.onPause();
		Log.d("FragmentName", this.getClass().getName()+"---------onPause ");
	}

	@Override
	public void onStop() {
		super.onStop();
		Log.d("FragmentName", this.getClass().getName()+"---------onStop ");
	}

	@Override
	public void onDestroy() {
		super.onDestroy();
		Log.d("FragmentName", this.getClass().getName()+"---------onDestroy ");
	}

	@Override
	protected void finalize() throws Throwable {
		super.finalize();
		Log.d("finalize",this.getClass().getName());
	}

}
